home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Include / include_i / workbench / workbench.i < prev   
Encoding:
Text File  |  1999-10-20  |  13.5 KB  |  424 lines

  1.     IFND    WORKBENCH_WORKBENCH_I
  2. WORKBENCH_WORKBENCH_I    EQU    1
  3. **
  4. **    $VER: workbench.i 44.1 (15.4.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    workbench.library general definitions
  8. **
  9. **    Copyright © 1985-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND    EXEC_TYPES_I
  14.     INCLUDE    "exec/types.i"
  15.     ENDC
  16.  
  17.     IFND    EXEC_NODES_I
  18.     INCLUDE    "exec/nodes.i"
  19.     ENDC
  20.  
  21.     IFND    EXEC_LISTS_I
  22.     INCLUDE    "exec/lists.i"
  23.     ENDC
  24.  
  25.     IFND    EXEC_TASKS_I
  26.     INCLUDE    "exec/tasks.i"
  27.     ENDC
  28.  
  29.     IFND    DOS_DOS_I
  30.     INCLUDE    "dos/dos.i"
  31.     ENDC
  32.  
  33.     IFND    INTUITION_INTUITION_I
  34.     INCLUDE    "intuition/intuition.i"
  35.     ENDC
  36.  
  37.  
  38. ; the Workbench object types
  39. WBDISK        EQU    1
  40. WBDRAWER    EQU    2
  41. WBTOOL        EQU    3
  42. WBPROJECT    EQU    4
  43. WBGARBAGE    EQU    5
  44. WBDEVICE    EQU    6
  45. WBKICK        EQU    7
  46. WBAPPICON    EQU    8
  47.  
  48. ; the main workbench object structure
  49.  STRUCTURE DrawerData,0
  50.     STRUCT    dd_NewWindow,nw_SIZE    ; args to open window
  51.     LONG    dd_CurrentX        ; current x coordinate of origin
  52.     LONG    dd_CurrentY        ; current y coordinate of origin
  53.     LABEL    OldDrawerData_SIZEOF    ; pre V36 size
  54. ; the amount of OldDrawerData actually written to disk
  55. OLDDRAWERDATAFILESIZE    EQU (OldDrawerData_SIZEOF)
  56.     ULONG    dd_Flags        ; flags for drawer
  57.     UWORD    dd_ViewModes        ; view mode for drawer
  58.     LABEL    DrawerData_SIZEOF
  59. ; the amount of DrawerData actually written to disk
  60. DRAWERDATAFILESIZE    EQU (DrawerData_SIZEOF)
  61.  
  62. ; definitions for dd_ViewModes
  63. DDVM_BYDEFAULT        equ 0    ; default (inherit parent's view mode)
  64. DDVM_BYICON        equ 1    ; view as icons
  65. DDVM_BYNAME        equ 2    ; view as text, sorted by name
  66. DDVM_BYDATE        equ 3    ; view as text, sorted by date
  67. DDVM_BYSIZE        equ 4    ; view as text, sorted by size
  68. DDVM_BYTYPE        equ 5    ; view as text, sorted by type
  69.  
  70. ; definitions for dd_Flags
  71. DDFLAGS_SHOWDEFAULT    equ 0    ; default (show only icons)
  72. DDFLAGS_SHOWICONS    equ 1    ; show only icons
  73. DDFLAGS_SHOWALL        equ 2    ; show all files
  74.  
  75.  STRUCTURE DiskObject,0
  76.     UWORD    do_Magic        ; a magic num at the start of the file
  77.     UWORD    do_Version        ; a version number, so we can change it
  78.     STRUCT    do_Gadget,gg_SIZEOF    ; a copy of in core gadget
  79.     UBYTE    do_Type
  80.     UBYTE    do_PAD_BYTE        ; Pad it out to the next word boundry
  81.     APTR    do_DefaultTool
  82.     APTR    do_ToolTypes
  83.     LONG    do_CurrentX
  84.     LONG    do_CurrentY
  85.     APTR    do_DrawerData
  86.     APTR    do_ToolWindow        ; only applies to tools
  87.     LONG    do_StackSize        ; applies to tools and projects
  88.     LABEL    do_SIZEOF
  89.  
  90. WB_DISKMAGIC    EQU    $e310    ; a magic number, not easily impersonated
  91. WB_DISKVERSION    EQU    1    ; our current version number
  92. WB_DISKREVISION    EQU    1    ; out current revision number
  93. ; I only use the lower 8 bits of Gadget.UserData for the revision #
  94. WB_DISKREVISIONMASK    EQU    $ff
  95.  
  96.  STRUCTURE FreeList,0
  97.     WORD    fl_NumFree
  98.     STRUCT    fl_MemList,LH_SIZE
  99.     ; weird name to avoid conflicts with FileLocks
  100.     LABEL    FreeList_SIZEOF
  101.  
  102.  
  103.  
  104. ; workbench does different complement modes for its gadgets.
  105. ; It supports separate images, complement mode, and backfill mode.
  106. ; The first two are identical to intuitions GFLG_GADGIMAGE and GFLG_GADGHCOMP.
  107. ; backfill is similar to GFLG_GADGHCOMP, but the region outside of the
  108. ; image (which normally would be color three when complemented)
  109. ; is flood-filled to color zero.
  110.  
  111. GFLG_GADGBACKFILL    EQU    $0001
  112. GADGBACKFILL        EQU    $0001    ; an old synonym
  113.  
  114. ; if an icon does not really live anywhere, set its current position
  115. ; to here
  116.  
  117. NO_ICON_POSITION    EQU    ($80000000)
  118.  
  119.  
  120. ; workbench now is a library.  this is it's name
  121. WORKBENCH_NAME    MACRO
  122.         dc.b        'workbench.library',0
  123.         ds.w        0
  124.         ENDM
  125.  
  126. ; If you find am_Version >= AM_VERSION, you now this structure has
  127. ; at least the fields defined in this version of the include file
  128. AM_VERSION    EQU    1
  129.  
  130.  STRUCTURE AppMessage,0
  131.     STRUCT am_Message,MN_SIZE    ; standard message structure
  132.     UWORD am_Type            ; message type
  133.     ULONG am_UserData        ; application specific
  134.     ULONG am_ID            ; application definable ID
  135.     LONG am_NumArgs            ; # of elements in arglist
  136.     APTR am_ArgList            ; the arguements themselves
  137.     UWORD am_Version        ; will be AM_VERSION
  138.     UWORD am_Class            ; message class
  139.     WORD am_MouseX            ; mouse x position of event
  140.     WORD am_MouseY            ; mount y position of event
  141.     ULONG am_Seconds        ; current system clock time
  142.     ULONG am_Micros            ; current system clock time
  143.     STRUCT am_Reserved,8        ; avoid recompilation
  144.     LABEL AppMessage_SIZEOF
  145.  
  146. ; types of app messages
  147. AMTYPE_APPWINDOW    EQU    7    ; app window message
  148. AMTYPE_APPICON        EQU    8    ; app icon message
  149. AMTYPE_APPMENUITEM    EQU    9    ; app menu item message
  150. AMTYPE_APPWINDOWZONE    EQU    10    ; app window drop zone message
  151.  
  152. ; Classes of AppIcon messages (V44)
  153. AMCLASSICON_Open    equ    0    ; The "Open" menu item was invoked,
  154.                     ; the icon got double-clicked or an
  155.                     ; icon got dropped on it.
  156. AMCLASSICON_Copy    equ    1    ; The "Copy" menu item was invoked
  157. AMCLASSICON_Rename    equ    2    ; The "Rename" menu item was invoked
  158. AMCLASSICON_Information    equ    3    ; The "Information" menu item was invoked
  159. AMCLASSICON_Snapshot    equ    4    ; The "Snapshot" menu item was invoked
  160. AMCLASSICON_UnSnapshot    equ    5    ; The "UnSnapshot" menu item was invoked
  161. AMCLASSICON_LeaveOut    equ    6    ; The "Leave Out" menu item was invoked
  162. AMCLASSICON_PutAway    equ    7    ; The "Put Away" menu item was invoked
  163. AMCLASSICON_Delete    equ    8    ; The "Delete" menu item was invoked
  164. AMCLASSICON_FormatDisk    equ    9    ; The "Format Disk" menu item was invoked
  165. AMCLASSICON_EmptyTrash    equ    10    ; The "Empty Trash" menu item was invoked
  166.  
  167. AMCLASSICON_Selected    equ    11    ; The icon is now selected
  168. AMCLASSICON_Unselected    equ    12    ; The icon is now unselected
  169.  
  170. ; The following structures are private.  These are just stub
  171. ; structures for code compatibility...
  172.  
  173.  STRUCTURE AppWindow,0
  174.     STRUCT aw_PRIVATE,0
  175.     LABEL AppWindow_SIZEOF
  176.  
  177.  STRUCTURE AppWindowDropZone,0
  178.     STRUCT awdz_PRIVATE,0
  179.     LABEL AppWindowDropZone_SIZEOF
  180.  
  181.  STRUCTURE AppIcon,0
  182.      STRUCT ai_PRIVATE,0
  183.     LABEL AppIcon_SIZEOF
  184.  
  185.  STRUCTURE AppMenuItem,0
  186.     STRUCT ami_PRIVATE,0
  187.     LABEL AppMenuItem_SIZEOF
  188.  
  189. ;----------------------------------------------------------------------------
  190.  
  191. WBA_Dummy equ    (TAG_USER+$A000)
  192.  
  193. ;----------------------------------------------------------------------------
  194.  
  195. ; Tags for use with AddAppIconA()
  196.  
  197. ; AppIcon responds to the "Open" menu item (BOOL).
  198. WBAPPICONA_SupportsOpen        equ    (WBA_Dummy+1)
  199.  
  200. ; AppIcon responds to the "Copy" menu item (BOOL).
  201. WBAPPICONA_SupportsCopy        equ    (WBA_Dummy+2)
  202.  
  203. ; AppIcon responds to the "Rename" menu item (BOOL).
  204. WBAPPICONA_SupportsRename    equ    (WBA_Dummy+3)
  205.  
  206. ; AppIcon responds to the "Information" menu item (BOOL).
  207. WBAPPICONA_SupportsInformation    equ    (WBA_Dummy+4)
  208.  
  209. ; AppIcon responds to the "Snapshot" menu item (BOOL).
  210. WBAPPICONA_SupportsSnapshot    equ    (WBA_Dummy+5)
  211.  
  212. ; AppIcon responds to the "UnSnapshot" menu item (BOOL).
  213. WBAPPICONA_SupportsUnSnapshot    equ    (WBA_Dummy+6)
  214.  
  215. ; AppIcon responds to the "LeaveOut" menu item (BOOL).
  216. WBAPPICONA_SupportsLeaveOut    equ    (WBA_Dummy+7)
  217.  
  218. ; AppIcon responds to the "PutAway" menu item (BOOL).
  219. WBAPPICONA_SupportsPutAway    equ    (WBA_Dummy+8)
  220.  
  221. ; AppIcon responds to the "Delete" menu item (BOOL).
  222. WBAPPICONA_SupportsDelete    equ    (WBA_Dummy+9)
  223.  
  224. ; AppIcon responds to the "FormatDisk" menu item (BOOL).
  225. WBAPPICONA_SupportsFormatDisk    equ    (WBA_Dummy+10)
  226.  
  227. ; AppIcon responds to the "EmptyTrash" menu item (BOOL).
  228. WBAPPICONA_SupportsEmptyTrash    equ    (WBA_Dummy+11)
  229.  
  230. ; AppIcon position should be propagated back to original DiskObject (BOOL).
  231. WBAPPICONA_PropagatePosition    equ    (WBA_Dummy+12)
  232.  
  233. ; Callback hook to be invoked when rendering this icon (struct Hook *).
  234. WBAPPICONA_RenderHook        equ    (WBA_Dummy+13)
  235.  
  236. ; AppIcon wants to be notified when its select state changes (BOOL).
  237. WBAPPICONA_NotifySelectState    equ    (WBA_Dummy+14)
  238.  
  239. ;------------------------------------------------------------------------------
  240.  
  241. ; Tags for use with AddAppMenuA()
  242.  
  243. ; Command key string for this AppMenu (STRPTR).
  244. WBAPPMENUA_CommandKeyString     equ    (WBA_Dummy+15)
  245.  
  246. ;------------------------------------------------------------------------------
  247.  
  248. ; Tags for use with OpenWorkbenchObjectA()
  249.  
  250. ; Corresponds to the wa_Lock member of a struct WBArg
  251. WBOPENA_ArgLock            equ    (WBA_Dummy+16)
  252.  
  253. ; Corresponds to the wa_Name member of a struct WBArg
  254. WBOPENA_ArgName            equ    (WBA_Dummy+17)
  255.  
  256. ;------------------------------------------------------------------------------
  257.  
  258. ; Tags for use with WorkbenchControlA()
  259.  
  260. ; Check if the named drawer is currently open (LONG *).
  261. WBCTRLA_IsOpen            equ    (WBA_Dummy+18)
  262.  
  263. ; Create a duplicate of the Workbench private search path list (BPTR *).
  264. WBCTRLA_DuplicateSearchPath    equ    (WBA_Dummy+19)
  265.  
  266. ; Free the duplicated search path list (BPTR).
  267. WBCTRLA_FreeSearchPath        equ    (WBA_Dummy+20)
  268.  
  269. ; Get the default stack size for launching programs with (ULONG *).
  270. WBCTRLA_GetDefaultStackSize    equ    (WBA_Dummy+21)
  271.  
  272. ; Set the default stack size for launching programs with (ULONG).
  273. WBCTRLA_SetDefaultStackSize    equ    (WBA_Dummy+22)
  274.  
  275. ; Cause an AppIcon to be redrawn (struct AppIcon *).
  276. WBCTRLA_RedrawAppIcon        equ    (WBA_Dummy+23)
  277.  
  278. ; Get a list of currently running Workbench programs (struct List **).
  279. WBCTRLA_GetProgramList        equ    (WBA_Dummy+24)
  280.  
  281. ; Release the list of currently running Workbench programs (struct List *).
  282. WBCTRLA_FreeProgramList        equ    (WBA_Dummy+25)
  283.  
  284. ; Get a list of currently selected icons (struct List **).
  285. WBCTRLA_GetSelectedIconList    equ    (WBA_Dummy+36)
  286.  
  287. ; Release the list of currently selected icons (struct List *).
  288. WBCTRLA_FreeSelectedIconList    equ    (WBA_Dummy+37)
  289.  
  290. ; Get a list of currently open drawers (struct List **).
  291. WBCTRLA_GetOpenDrawerList    equ    (WBA_Dummy+38)
  292.  
  293. ; Release the list of currently open icons (struct List *).
  294. WBCTRLA_FreeOpenDrawerList    equ    (WBA_Dummy+39)
  295.  
  296. ; Get the list of hidden devices (struct List **).
  297. WBCTRLA_GetHiddenDeviceList    equ    (WBA_Dummy+42)
  298.  
  299. ; Release the list of hidden devices (struct List *).
  300. WBCTRLA_FreeHiddenDeviceList    equ    (WBA_Dummy+43)
  301.  
  302. ; Add the name of a device which Workbench should never try to
  303. ; read a disk icon from (STRPTR).
  304. WBCTRLA_AddHiddenDeviceName    equ    (WBA_Dummy+44)
  305.  
  306. ; Remove a name from list of hidden devices (STRPTR).
  307. WBCTRLA_RemoveHiddenDeviceName    equ    (WBA_Dummy+45)
  308.  
  309. ; Get the number of seconds that have to pass before typing
  310. ; the next character in a drawer window will restart
  311. ; with a new file name (ULONG *).
  312. WBCTRLA_GetTypeRestartTime    equ    (WBA_Dummy+47)
  313.  
  314. ; Set the number of seconds that have to pass before typing
  315. ; the next character in a drawer window will restart
  316. ; with a new file name (ULONG).
  317. WBCTRLA_SetTypeRestartTime    equ    (WBA_Dummy+48)
  318.  
  319. ;------------------------------------------------------------------------------
  320.  
  321. ; Tags for use with AddAppWindowDropZoneA()
  322.  
  323. ; Zone left edge (WORD)
  324. WBDZA_Left    equ    (WBA_Dummy+26)
  325.  
  326. ; Zone left edge, if relative to the right edge of the window (WORD)
  327. WBDZA_RelRight    equ    (WBA_Dummy+27)
  328.  
  329. ; Zone top edge (WORD)
  330. WBDZA_Top    equ    (WBA_Dummy+28)
  331.  
  332. ; Zone top edge, if relative to the bottom edge of the window (WORD)
  333. WBDZA_RelBottom    equ    (WBA_Dummy+29)
  334.  
  335. ; Zone width (WORD)
  336. WBDZA_Width    equ    (WBA_Dummy+30)
  337.  
  338. ; Zone width, if relative to the window width (WORD)
  339. WBDZA_RelWidth    equ    (WBA_Dummy+31)
  340.  
  341. ; Zone height (WORD)
  342. WBDZA_Height    equ    (WBA_Dummy+32)
  343.  
  344. ; Zone height, if relative to the window height (WORD)
  345. WBDZA_RelHeight    equ    (WBA_Dummy+33)
  346.  
  347. ; Zone position and size (struct IBox *).
  348. WBDZA_Box    equ    (WBA_Dummy+34)
  349.  
  350. ; Hook to invoke when the mouse enters or leave a drop zone (struct Hook *).
  351. WBDZA_Hook    equ    (WBA_Dummy+35)
  352.  
  353. ;------------------------------------------------------------------------------
  354.  
  355. ; The message your AppIcon rendering hook gets invoked with.
  356.     STRUCTURE AppIconRenderMsg,0
  357.     APTR    arm_RastPort    ; RastPort to render into
  358.     APTR    arm_Icon    ; The icon to be rendered
  359.     APTR    arm_Label    ; The icon label txt
  360.     APTR    arm_Tags    ; Further tags to be passed on
  361.                         ; to DrawIconStateA().
  362.  
  363.     WORD    arm_Left    ; \ Rendering origin, not taking the
  364.     WORD    arm_Top        ; / button border into account.
  365.  
  366.     WORD    arm_Width    ; \ Limit your rendering to
  367.     WORD    arm_Height    ; / this area.
  368.  
  369.     ULONG    arm_State    ; IDS_SELECTED, IDS_NORMAL, etc.
  370.     LABEL AppIconRenderMsg_SIZEOF
  371.  
  372. ;----------------------------------------------------------------------------
  373.  
  374. ; The message your drop zone hook gets invoked with.
  375.     STRUCTURE AppWindowDropZoneMsg,0
  376.         APTR    adzm_RastPort            ; RastPort to render into.
  377.     STRUCT    adzm_DropZoneBox,ibox_SIZEOF    ; Limit your rendering to this area.
  378.     ULONG    adzm_ID                ; \ These come from straight
  379.     ULONG    adzm_UserData            ; / from AddAppWindowDropZoneA().
  380.     LONG    adzm_Action            ; See below for a list of actions.
  381.     LABEL AppWindowDropZoneMsg_SIZEOF
  382.  
  383. ADZMACTION_Enter    equ (0)
  384. ADZMACTION_Leave    equ (1)
  385.  
  386. ;----------------------------------------------------------------------------
  387.  
  388. ; The message your icon selection change hook is invoked with.
  389.     STRUCTURE IconSelectMsg,0
  390.         ULONG    ism_Length            ; Size of this data structure
  391.                         ; (in bytes).
  392.         BPTR    ism_Drawer            ; Lock on the drawer this object
  393.                         ; resides in, NULL for Workbench
  394.                         ; backdrop (devices).
  395.     APTR    ism_Name            ; Name of the object in question.
  396.     UWORD    ism_Type            ; One of WBDISK, WBDRAWER, WBTOOL,
  397.                         ; WBPROJECT, WBGARBAGE, WBDEVICE,
  398.                         ; WBKICK or WBAPPICON.
  399.     BOOL    ism_Selected            ; TRUE if currently selected,
  400.                         ; FALSE otherwise.
  401.     APTR    ism_Tags            ; Pointer to the list of tag items
  402.                         ; passed to
  403.     APTR    ism_DrawerWindow        ; Pointer to the window attached
  404.                         ; to this icon, if the icon is
  405.                         ; a drawer-like object.
  406.     APTR    ism_ParentWindow        ; Pointer to the window the icon
  407.                         ; resides in
  408.     WORD    ism_Left            ; Position and size of the icon;
  409.     WORD    ism_Top                ; note that the icon may not entirely
  410.     WORD    ism_Width            ; visible bounds of the parent window.
  411.     WORD    ism_Height
  412.     LABEL IconSelectMsg_SIZEOF
  413.  
  414. ; These are the values your hook code can return
  415. ISMACTION_Unselect    equ    (0)    ; Unselect the icon
  416. ISMACTION_Select    equ    (1)    ; Select the icon
  417. ISMACTION_Ignore    equ    (2)    ; Do not change the selection state.
  418. ISMACTION_Stop        equ    (3)    ; Do not invoke the hook code again,
  419.                     ; leave the icon as it is.
  420.  
  421. ;----------------------------------------------------------------------------
  422.  
  423.     ENDC    ; WORKBENCH_WORKBENCH_I
  424.